'use strict'

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = (app) => {
    const { router, controller, middleware, config, io } = app

    // 重定向到swagger
    // router.redirect('/', '/swagger-ui.html', 302)

    const jwt = middleware.jwt(config.jwt)

    router.post('/user/login', controller.user.login)

    router.get('/house/getHouses', controller.house.house.getHouses)

    router.post('/house/getHouseById', controller.house.house.getHouseById)

    router.post('/house/getHouseTypeById', controller.house.houseType.getHouseTypeById)

    router.get('/house/getMatching', controller.house.matching.getMatching)

    router.post('/user/getUserByAccount', jwt, controller.user.getUserByAccount)
}
